package cn.ronghuanet.auth.mapper;

import cn.ronghuanet.auth.domain.Role;
import cn.ronghuanet.auth.query.RoleQuery;
import cn.ronghuanet.basic.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

public interface RoleMapper extends BaseMapper<Role> {


    Role loadByName(String name);

    Role loadBySn(String sn);

    void deleteByRoleId(Long roleId);

    /**
     * 如果mapper.java中方法需要接收多个参数的话,参数前一定要使用@Param
     * 如果mapper.java中已经用@Param指明了集合的名称的话,mapper.xml中在循环时就只能使用@Param中的名字
     * @param roleId
     * @param permissionSns
     */
    void saveRolePermission(@Param("roleId") Long roleId,@Param("permissionSns") List<String> permissionSns);

    List<String> getRolePermissionSns(Long roleId);
}
